﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace FortuneHeaven.Web
{
    public partial class downloadfile : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            /* 这里打包游戏。。。。根据kindid，打包不同的下载地址
INSERT GameKindItem (KindID, TypeID, KindName, ProcessName, MaxVersion, SortID, Nullity, DataBaseName) VALUES ( 100, 1, '中国象棋', 'CHNChess.exe', 67078, 100, 0, 'QPTreasureDB')
INSERT GameKindItem (KindID, TypeID, KindName, ProcessName, MaxVersion, SortID, Nullity, DataBaseName) VALUES ( 101, 1, '五子棋', 'GoBang.exe', 67078, 100, 0, 'QPTreasureDB')
INSERT GameKindItem (KindID, TypeID, KindName, ProcessName, MaxVersion, SortID, Nullity, DataBaseName) VALUES ( 102, 1, '四国军棋', 'FourEnsign.exe', 67078, 100, 0, 'QPTreasureDB')

             */
            if (!IsPostBack)
            {
                //http://220.241.42.205/Download.asp?KindID=%ld&LocalVersion=0&PlazaVersion=%ld
                string kindid = Request.QueryString["kindid"];
                if (!string.IsNullOrEmpty(kindid))
                {
                    string url = "download/";
                    switch (kindid)
                    {
                        case "0":
                            url += "cfttplazefull.exe";
                            break;
                        case "613":    //613
                            url += "3DSLWG_CLIENT.exe";
                            break;
                        case "101":
                            url += "GoBang.exe";
                            break;
                        case "630":
                            url += "shark.exe";
                            break;
                        case "621":
                            url += "RaceHorse.exe";
                            break;
                        case "104":
                            url += "LLShow.exe";
                            break;
                        case "106":
                            url += "Billiards.exe";
                            break;
                        case "100":
                            url += "CHNChess.exe";
                            break;
                        case "102":
                            url += "FourEnsign.exe";
                            break;
                        case "103":
                            url += "WeiQi.exe";
                            break;
                        case "105":
                            url += "Plane.exe";
                            break;
                        case "614":
                            url += "3DSLWG_CLIENT_Normal.exe";
                            break;
                        case "620":
                            url += "fish.exe";
                            break;
                        case "622":
                            url += "BBC.exe";
                            break;
                        case "300":
                            url += "Baccarat.exe";
                            break;
                        case "301":
                            url += "DZShowHand.exe";
                            break;
                        case "302":
                            url += "Ox.exe";
                            break;
                        case "303":
                            url += "ZaJinHua.exe";
                            break;
                        case "304":
                            url += "28Gang.exe";
                            break;
                        case "305":
                            url += "Ox100.exe";
                            break;
                        case "306":
                            url += "Land.exe";
                            break;
                        case "307":
                            url += "LandEX.exe";
                            break;
                        case "308":
                            url += "SparrowDZ.exe";
                            break;
                        case "309":
                            url += "OddEven.exe";
                            break;
                        default:
                            break;
                    }

                    Response.Redirect(url);
                }
            }
        }
    }
}